const webpack = require('webpack') 
const webpackDevServer = require("webpack-dev-server")

const webpackConfig = require('../config/webpack.dev.conf')

const compiler = webpack(webpackConfig) //创建compiler实例，确定打包配置
const devServerOptions = {...webpackConfig.devServer,open:true} //生成开发服务配置
const server = new webpackDevServer(devServerOptions,compiler) //创建server实例
 server.startCallback(()=>{
   
})  //调用这行代码开启一个服务
const logInternalIPs = async () => {
    const localIPv4 = await webpackDevServer.internalIP('v4');
    const localIPv6 = await webpackDevServer.internalIP('v6');
  
    console.log('Local IPv4 address:', localIPv4);
    console.log('Local IPv6 address:', localIPv6);
  };
  
  logInternalIPs();